<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" isELIgnored="false"%>

<%
	request.setAttribute("title","车险测算信息");
	request.setAttribute("modelConfigPath", "tp");
%>

<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<style type="text/css">
p {
	font-size: 20px;
	margin: 0 10px 10px 10px;
	color: cadetblue;
}

.content {
	margin-buttom: 28px;
}
</style>
<t:panel cssClass="panel-flat form-detailed" customBody="true" customHead="true">
	<div class="detailed-navbar-content panel-body">
		<t:form commandName="testCarCollection" action="/admin/zzb/testCarCollection/save" method="post" cssClass="form-horizontal">
			<div class="hide">
				<t:hidden path="id" />
				<t:hidden path="deleteMark" />
			</div>
			<t:formgroup>
				<t:label path="customerId" cssClass="col-sm-2" />
				<t:input path="customerId" colClass="col-sm-2" />
				<t:label path="productName" cssClass="col-sm-2" />
				<t:input path="productName" colClass="col-sm-2" />
			</t:formgroup>
			<t:formgroup>
				<t:label path="provinceId" cssClass="col-sm-2" />
				<t:select2 path="provinceId" colClass="col-sm-2" />
				<t:select2 path="cityId" colClass="col-sm-2" />
			</t:formgroup>
			<t:formgroup>
				<t:label path="insuName" cssClass="col-sm-2" />
				<t:input path="insuName" colClass="col-sm-2" />
				<t:label path="buyerIdentity" cssClass="col-sm-2" />
				<t:select2 path="buyerIdentity" colClass="col-sm-2" />
				<t:label path="carLicenseNo" cssClass="col-sm-2" />
				<t:input path="carLicenseNo" colClass="col-sm-2" />
			</t:formgroup>
			<t:formgroup>
				<t:label path="carOwener" cssClass="col-sm-2" />
				<t:input path="carOwener" colClass="col-sm-2" />
				<t:label path="phone" cssClass="col-sm-2" />
				<t:input path="phone" colClass="col-sm-2" />
				<t:label path="email" cssClass="col-sm-2" />
				<t:input path="email" colClass="col-sm-2" />
			</t:formgroup>
			<t:formgroup>
				<t:label path="isTransfer" cssClass="col-sm-2" />
				<t:select2 path="isTransfer" colClass="col-sm-2" />
				<t:label path="isLoan" cssClass="col-sm-2" />
				<t:select2 path="isLoan" colClass="col-sm-2" />
				<c:if test="${testCarCollection =='0'}">
					<t:label path="loanBrank" cssClass="col-sm-2" />
					<t:input path="loanBrank" colClass="col-sm-2" />
				</c:if>
			</t:formgroup>
			<t:formgroup>
				<t:label path="vehicleDemageIns" cssClass="col-sm-2" />
				<t:select2 path="vehicleDemageIns" colClass="col-sm-2" />
				<t:label path="thirdPartyIns" cssClass="col-sm-2" />
				<t:select2 path="thirdPartyIns" colClass="col-sm-2" />
				<t:label path="driverIns" cssClass="col-sm-2" />
				<t:select2 path="driverIns" colClass="col-sm-2" />
			</t:formgroup>
			<t:formgroup>
				<t:label path="passengerIns" cssClass="col-sm-2" />
				<t:select2 path="passengerIns" colClass="col-sm-2" />
				<t:label path="theftIns" cssClass="col-sm-2" />
				<t:select2 path="theftIns" colClass="col-sm-2" />
				<t:label path="glassIns" cssClass="col-sm-2" />
				<t:select2 path="glassIns" colClass="col-sm-2" />
			</t:formgroup>
			<t:formgroup>
				<t:label path="combustionIns" cssClass="col-sm-2" />
				<t:select2 path="combustionIns" colClass="col-sm-2" />
				<t:label path="scratchIns" cssClass="col-sm-2" />
				<t:select2 path="scratchIns" colClass="col-sm-2" />
				<t:label path="sadingIns" cssClass="col-sm-2" />
				<t:select2 path="sadingIns" colClass="col-sm-2" />
			</t:formgroup>
			<t:formgroup>
				<t:label path="vehicleDemageMissedThirdPartyCla" cssClass="col-sm-2" />
				<t:select2 path="vehicleDemageMissedThirdPartyCla" colClass="col-sm-2" />
				<t:label path="specifyingPlantCla" cssClass="col-sm-2" />
				<t:select2 path="specifyingPlantCla" colClass="col-sm-2" />
				<t:label path="newEquipmentIns" cssClass="col-sm-2" />
				<t:select2 path="newEquipmentIns" colClass="col-sm-2" />
			</t:formgroup>
			<t:formgroup>
				<t:label path="goodsOnVehicleIns" cssClass="col-sm-2" />
				<t:select2 path="goodsOnVehicleIns" colClass="col-sm-2" />
				<t:label path="compensationForMentalDistressIns" cssClass="col-sm-2" />
				<t:select2 path="compensationForMentalDistressIns" colClass="col-sm-2" />

			</t:formgroup>
			<t:formgroup>
				<div class="col-sm-6">
					<t:label path="idCardFace" cssClass="col-sm-4" />
					<c:if test="${idCardFace!=null && idCardFace!=''}">
						<img style="width: 300px; height: 180px;" id="smallPicShow" src="${tfn:getFileUrl(idCardFace)}" />
					</c:if>
					<c:if test="${idCardFace==null || idCardFace==''}">
						<t:input path="createDate" colClass="col-sm-8" value="无" />
					</c:if>
				</div>
				<div class="col-sm-6">
					<t:label path="idCardBack" cssClass="col-sm-4" />
					<c:if test="${idCardBack!=null && idCardBack!=''}">
						<img style="width: 300px; height: 180px;" id="smallPicShow" src="${tfn:getFileUrl(idCardBack)}" />
					</c:if>
					<c:if test="${idCardBack==null || idCardBack==''}">
						<t:input path="createDate" colClass="col-sm-8" value="无" />
					</c:if>
				</div>
			</t:formgroup>

			<t:formgroup>
				<div class="col-sm-6">
					<t:label path="licenseNoFacae" cssClass="col-sm-4" />
					<c:if test="${licenseNoFacae!=null && licenseNoFacae!=''}">
						<img style="width: 300px; height: 180px;" id="smallPicShow" src="${tfn:getFileUrl(licenseNoFacae)}" />
					</c:if>
					<c:if test="${licenseNoFacae==null || licenseNoFacae==''}">
						<t:input path="createDate" colClass="col-sm-8" value="无" />
					</c:if>
				</div>
				<div class="col-sm-6">
					<t:label path="licenseNoBack" cssClass="col-sm-4" />
					<c:if test="${licenseNoBack!=null && licenseNoBack!=''}">
						<img style="width: 300px; height: 180px;" id="smallPicShow" src="${tfn:getFileUrl(licenseNoBack)}" />
					</c:if>
					<c:if test="${licenseNoBack==null || licenseNoBack==''}">
						<t:input path="createDate" colClass="col-sm-8" value="无" />
					</c:if>
				</div>
			</t:formgroup>
			<t:formgroup>
				<t:label path="comfirmStatus" cssClass="col-sm-2" />
				<t:input path="comfirmStatus" colClass="col-sm-2" />
			</t:formgroup>
		</t:form>
	</div>
</t:panel>

<script type="text/javascript">

	function saveData(){
		if (!$("form:first").valid()){
			return;
		}
		$("form:first").submit();
	}	
	
	$(function(){
		 $("#provinceId").on("change",function(){
			 var provinceId=$("#provinceId").val();
			 loadProvinceSelect2(provinceId); 
		}); 
		initProvinceCity();
		
	});

   function initProvinceCity(){
   	var provinceId=$("#provinceId").val();
		var cityId=$("#cityId").val();
		if($.isNull(provinceId)){
			 provinceId = 'all';
			 loadProvinceSelect2(provinceId); 
		}else{
			loadProvinceSelect2(provinceId,cityId);
		}
		
   };
	
	function loadProvinceSelect2(keyId,cityId){
		
		$("#provinceId option").remove();
		$("#cityId option").remove();
		/* var pre = '';
		var suf = ''; */
		var url=$.getVirtualPath()+"/admin/team/cooperationTeam/provinceCity?keyId=all";
		var provinces =$.getJsonPost(url);
       var optProvince=[];
       
       $.each(provinces,function(index,province){
			var proSelected="";
			proSelected=province.id.indexOf(keyId)>=0?"selected=selected":"";
			/* if(province.id.indexOf(keyId)>=0){
				pre = province.paramValue;
				proSelected = "selected=selected";
			} */
			optProvince.push("<option "+proSelected+" value='"+province.id+"'>"+province.paramValue+"</option>");
	    });
       $("#provinceId").append(optProvince);
       
       
       url=$.getVirtualPath()+"/admin/team/cooperationTeam/provinceCity?keyId=" + $("#provinceId").val();
		var citys =$.getJsonPost(url);
       var optCity=[];
       
       $.each(citys,function(index,city){
			var citySelected="";
			citySelected=city.id.indexOf(cityId)>=0?"selected=selected":"";	 
			/* if(city.id.indexOf(cityId)>=0){
				suf = city.paramValue;
				citySelected = "selected=selected";
			} */
			
			optCity.push("<option "+citySelected+" value='"+city.id+"'>"+city.paramValue+"</option>");
	    });
       $("#cityId").append(optCity);

	}
</script>
<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/dialog.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>
